package com.ash.service.book;

import com.ash.mapper.book.BookTypeMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author : Chen Chao
 * @encoding : UTF-8
 * @date : 2021/4/11 14:27
 * @file : project06.com.ash.service.book.BookTypeServiceImpl.java
 * @software : IntelliJ IDEA
 * @since : 1.8
 */
@Service
public class BookTypeServiceImpl implements BookTypeService {
    @Resource
    BookTypeMapper bookTypeMapper;
    @Override
    public Integer addType(Integer bid, List<Integer> bookTypes) {
        return bookTypeMapper.addType(bid,bookTypes);
    }

    @Override
    public List<Integer> selectTypeByBid(Integer bid) {
        return bookTypeMapper.selectTypeByBid(bid);
    }

    @Override
    public Integer changeType(Integer bid, List<Integer> bookTypes) {
        bookTypeMapper.deleteByBid(bid);
        return bookTypeMapper.addType(bid,bookTypes);
    }
}
